import request from '@/axios'

//菜单配置首次加载系统数据
export const treeApi = () => {
  return request.get({ url: '/rbac-server/rbac/menu/tree' })
}
//加载菜单树子集
export const childsApi = (sysId, parentId) => {
  return request.get({ url: '/rbac-server/rbac/menu/childs', params: { sysId, parentId } })
}
//分页获取菜单配置
export const pageApi = (data) => {
  return request.post({ url: '/rbac-server/rbac/menu/page', data })
}

//新增菜单配置
export const addApi = (data) => {
  return request.post({ url: '/rbac-server/rbac/menu/add', data })
}
//获取菜单配置
export const getApi = (params) => {
  return request.get({ url: '/rbac-server/rbac/menu/get', params })
}
//删除菜单配置
export const delApi = (id) => {
  return request.delete({ url: '/rbac-server/rbac/menu/delete', params: { id } })
}
//修改菜单配置
export const updateApi = (data) => {
  return request.put({ url: '/rbac-server/rbac/menu/update', data })
}
//菜单配置排序
export const sortApi = (params) => {
  return request.put({ url: '/rbac-server/rbac/menu/sort', params })
}
